<%@page import="com.windfone.common.Constant"%>
<%@ page language="java" contentType="text/html; charset=utf-8"    pageEncoding="utf-8"%>
<%@ taglib uri="/WEB-INF/recommend.tld" prefix="windfone" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>风驰电讯 您最贴心的手机顾问 用户注册</title>
<%@ include file="headkey.jsp" %>
<%@ include file="head.jsp" %>
<link href="css/css.css" rel="stylesheet" type="text/css" />
 <script type="text/javascript" src="js/jquery-1.4.2.js"></script>
<script>

function checkName(){
	var loginName = $("#loginName").val();  
	var checkNameHidden = $("#checkNameHidden");
	if ( loginName !=""){
	$.ajax({  
	    type:"post",  
	    url:"<%=contextPath%>/checkLoginName.action",  
	    data:{loginName:loginName},  
     	success: function(msg){
	    	if ( msg == true ){
	    		checkNameHidden.attr("value","false");
		    	document.getElementById("msg").innerHTML = "<font color=red>已有该用户</font>";
	    	}
		    else {
		    	checkNameHidden.attr("value","true");
	    		document.getElementById("msg").innerHTML = "<font color=green>可以使用该账号</font>";
		    }
	 	} 
	});
	}
}

function checkonSubmit(){
	var userRegistFrm = document.getElementById("userRegistFrm");
	if ( $("#loginName").val() ==""){
		alert("用户登录名不允许为空");
		$("#loginName").focus();
		return false;
	} else {
		var checkNameHidden = $("#checkNameHidden");
		if ( checkNameHidden.val() == "false"){
		alert("已有该用户");
		$("#loginName").focus();
		return false;
		}
	}
	if ( $("#password").val() ==""){
		alert("密码不允许为空");
		$("#password").focus();
		return false;
	} 
	if ( $("#confpassword").val() ==""){
		alert("确认密码不允许为空");
		$("#confpassword").focus();
		return false;
	} 
	if ( $("#confpassword").val() != $("#password").val()){
		alert("两次密码不正确");
		$("#password").focus();
		return false;
	} 
	var loginName = $("#loginName").val();  
	$.ajax({  
	    type:"post",  
	    url:"<%=contextPath%>/checkLoginName.action",  
	    data:{loginName:loginName},  
     	success: function(msg){
	    	if ( msg == false )
				userRegistFrm.submit();
	 	} 
	});
}
</script>
</head>

<body id="pages9">
 
<!--头部--> 
 <%@ include file="navigate.jsp"%>
<!--内容-->
<div class="contentBox">
<!--左区-->
<div class="col1">
  <div class="tabLeBox">
    <div class="title">
      <h3>风驰通讯各分店</h3>
    </div>
    <div class="borderBox">
      <table width="100%" border="0" cellspacing="0" cellpadding="0" class="addBox">
        <tr>
          <td style="text-align:center"><img src="images/pic1.gif" /></td>
        </tr>
        <tr>
          <td class="addInfo">深圳市南山区学府路康乐大 廈首层 0755-26416166</td>
        </tr>
        <tr>
          <td class="addInfo">深圳市南山区东滨路新一代 国际公寓首层 0755-86175799</td>
        </tr>
        <tr>
          <td class="addInfo" style="border:none;">深圳市福田区华强北鼎城国际大厦16楼 0755-83777724</td>
        </tr>
      </table>
      <div class="clear"></div>
    </div>
  </div>
  <div class="clear"></div>
</div>
<div class="col2">
  <div class="tabLeBoxB" style=" padding-top:0">
  <div class="title">
    <h3>会员注册</h3></div>
<div class="borderBox" style="height:500px;">
<table width="750" align="center">   
    	<tbody>
        <tr>
          <td align="center">
            <form method="post" action="addRegisterUser.action" name="userRegistFrm" id="userRegistFrm">
              <div align="center">
                <ul class="oper_list">
                  <li class="item" id="LNameTitle">登录名称</li>
                  <li class="item">
                    <input type="text" style="width: 200px;" onblur="checkName()" id="loginName" maxlength="20" name="loginName"/>
                    <input type="hidden" id="checkNameHidden" value="false" name="checkNameHidden"/>
                    <span id="msg"></span>
                    </li>
                  <li class="item_err" id="LNameMsg"></li>
                  <li class="title">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您的用户名直可以包含：字母、数字、下划线</li>
                  </ul>
                <ul class="oper_list">	
                  <li class="item" id="LPWDTitle">登录密码</li>
                  <li class="item"><input type="password" style="width: 200px;" id="password" maxlength="50" name="password"/></li>
                  <li class="item_err" id="LPWDMsg"></li>
                  <li class="title">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6-12 位，可以使用：字母、数字、符号</li>
                  </ul>			
                <ul class="oper_list">
                  <li class="item" id="LRPWDTitle">确认密码</li>
                  <li class="item"><input type="password" style="width: 200px;" id="confpassword" maxlength="50" name="confpassword"/></li>
                  <li class="item_err" id="LRPWDMsg"></li>
                  <li class="title">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重新输入登录密码</li>
                  </ul>
                <ul class="oper_list">
                  <li class="item" id="UEmailTitle">邮箱地址</li>
                  <li class="item">
                    <input type="text" style="width: 200px;" id="email" maxlength="100" name="email"/>
                    </li>
                  <li class="item_err" id="UEmailMsg"></li>
                  <li class="title">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;请正确输入您的电子邮件，以便接收商城信息，以及找回您的密码</li>
                  </ul>
	               <ul class="oper_list">
					<s:token></s:token>
					<li class="item">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green"><s:property value='rtvMsg'/></font></li>
					</ul>
                </div>   
              </form>
            </td>
        </tr>
        <tr>
        	<td>
        	<input type="image" src="images/reg_btnreg.png" style="border-width: 0px;" onclick="checkonSubmit();return false"/>
        	</td>
        </tr>
   
       
    </tbody></table>
</div>
</div>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
   <%@ include file="bottom.jsp" %>
</body>
</html>

